// **** gamevars needed for the HAZARD Actor ****
gamevar HAZARD_LEVEL 0 2
gamevar HAZ_HI 0 2        // took out hitage for now
gamevar ZERO 0 0


// **** HEAT_ID state ****
state HEAT_ID
  ifrnd 64
  {
    redefinequote 152 ^23WARNING!  HEAT LEVEL %d!
    qsprintf 152 152 HAZARD_LEVEL 
    quote 152
  }
ends


// **** HEAT_ID_EXPOSURE state ****
state HEAT_ID_EXPOSURE
  ifrnd 64
  {
    redefinequote 152 ^23WARNING!  HEAT LEVEL %d EXPOSURE!
    qsprintf 152 152 HAZARD_LEVEL 
    quote 152
  }
ends


// **** HEAT_LEVEL_0 state ****
// HURT FLOORS AND HAZARD ACTOR
state HEAT_LEVEL_0
      ifg player[].boot_amount 0
        quote 75    // you need to make it say "HAZARD SHILED or BOOTS ACTIVE"
      else
        ifg player[].shield_amount 0
          state HEAT_ID
        else
        {
          state HEAT_ID_EXPOSURE
          ifrnd 2
	  { 
	    ifrnd 64 globalsound DUKE_GRUNT
            addphealth -1
	    palfrom 2 0
	  }
        }    
ends 


// **** HEAT_LEVEL_1 state ****
// HURT FLOORS AND HAZARD ACTOR
state HEAT_LEVEL_1
      ifg player[].boot_amount 0 
        quote 75    // you need to make it say "HAZARD SHILED or BOOTS ACTIVE"
      else
        ifg player[].shield_amount 0
          state HEAT_ID
        else
        {
          state HEAT_ID_EXPOSURE
          ifrnd 8
	  { 
	    ifrnd 64 globalsound DUKE_GRUNT
            addphealth -1
	    palfrom 8 3
	  }
        }    
ends 


eventloadactor HAZARD
{
    getactor[THISACTOR].lotag HAZARD_LEVEL
    getactor[THISACTOR].hitag HAZ_HI
    setactor[THISACTOR].lotag ZERO
    setactor[THISACTOR].hitag ZERO
    cstat 32768   
}
enda


// **** The Hazard Actor ****
actor HAZARD
  ife player[].cursectnum sprite[].sectnum
  {
    ifspritepal 2
    {
      ifvare HAZARD_LEVEL 0 
        state HEAT_LEVEL_0	 // no damage to haz shield (boots) or shield
      else
        ifvare HAZARD_LEVEL 1 
          state HEAT_LEVEL_1     // no damage to haz shield (boots) or shield
    }
  }
enda